<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui">



	<ui:include src="/academy/academyWelcome.xhtml"/>
 
 	<p:outputPanel layout="block" style="height:95%">
	
		<p:tabView id="tabUser" dynamic="true"  style="border:none;min-height:90%" effect="slide" rendered="#{academyBean.academy != null}"  >
			<p:tab id="tabUserData"  		title="#{msgs.RegistrationData}"  titleStyleClass="ui-widget">
				<h:form id="academyForm" prependId="false"  >
					<ui:include src="/academy/academyData.xhtml" />
					<div align="left"   >
						<p:outputPanel layout="block" rendered="#{academyBean.academy != null}">
							<p:commandButton  value="#{msgs.Save}"		action="#{academyBean.saveAcademy}"		 	
								ajax="true"	update=":growl,:content"		icon="ui-icon-disk"	rendered="#{academyBean.academy.id != null}" />
							<p:commandButton  value="#{msgs.Create}"	action="#{academyBean.createAcademy}"	 		
								ajax="true"	update=":growl,:content"		icon="ui-icon-document"	rendered="#{academyBean.academy.id == null}" />
							<p:spacer width="50px"/>	
							<p:commandButton  value="#{msgs.Cancel}"	action="#{academyBean.cancelChange}"	icon="ui-icon-cancel"/>
						</p:outputPanel>
					</div>
				</h:form>
			</p:tab>
			<p:tab id="tabUserEquipments" 	title="#{msgs.Equipments}" titleStyleClass="ui-widget">
				<ui:include src="/academy/academyEquipments.xhtml" />
			</p:tab> 
			<p:tab id="tabUserAccess" 		title="#{msgs.Access}" titleStyleClass="ui-widget" rendered="#{p:ifAnyGranted('ROLE_ADMIN')}">
				<ui:include src="/academy/academyRoles.xhtml" />
			</p:tab>
		</p:tabView>

	</p:outputPanel>
</html>